{% load i18n %}
{% load static %}
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover"/>
    <meta http-equiv="X-UA-Compatible" content="ie=edge"/>
    <title>CloudLte</title>
    <!-- CSS files -->
    <link href="{% static "dist/css/tabler.min.css" %}" rel="stylesheet"/>
    <link href="{% static "dist/css/tabler-flags.min.css" %}" rel="stylesheet"/>
    <link href="{% static "dist/css/tabler-payments.min.css" %}" rel="stylesheet"/>
    <link href="{% static "dist/css/tabler-vendors.min.css" %}" rel="stylesheet"/>
    <link href="{% static "dist/css/demo.min.css" %}" rel="stylesheet"/>
    <style>
      @import url('https://rsms.me/inter/inter.css');
      :root {
      	--tblr-font-sans-serif: Inter, -apple-system, BlinkMacSystemFont, San Francisco, Segoe UI, Roboto, Helvetica Neue, sans-serif;
      }
    </style>
  </head>
  <body  class=" d-flex flex-column bg-white">
    <script src="{% static "dist/js/demo-theme.min.js" %}"></script>
    <div class="row g-0 flex-fill">
      <div class="col-12 col-lg-6 col-xl-4 border-top-wide border-primary d-flex flex-column justify-content-center">
        <div class="container container-tight my-5 px-lg-5">
          <div class="text-center mb-4">
            <a href="." class="navbar-brand navbar-brand-autodark"><img src="{% static "images/site_header.png" %}" height="36" alt=""></a>
          </div>
          {% comment %} <h2 class="h3 text-center mb-3">
            登&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;录
          </h2> {% endcomment %}
          <form action="#" method="post" autocomplete="off" novalidate>{% csrf_token %}
            <div class="mb-3">
              <label class="form-label">用户名:</label>
              <input type="text" name="username" class="form-control" placeholder="UserName" autocomplete="off">
            </div>
            <div class="mb-2">
              <label class="form-label">
                密&nbsp;&nbsp;码:
              </label>
              <div class="input-group input-group-flat">
                <input type="password" name="password" class="form-control"  placeholder="Password"  autocomplete="off">
                <span class="input-group-text">
                  <a href="#" class="link-secondary" title="Show password" data-bs-toggle="tooltip"><!-- Download SVG icon from http://tabler-icons.io/i/eye -->
                    <svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><circle cx="12" cy="12" r="2" /><path d="M22 12c-2.667 4.667 -6 7 -10 7s-7.333 -2.333 -10 -7c2.667 -4.667 6 -7 10 -7s7.333 2.333 10 7" /></svg>
                  </a>
                </span>
              </div>
            </div>
            <div class="mb-2">
            {% if form.errors %}
                <div class="interval-hint"><i style="color:red;">用户名或密码错误，请重新输入。</i></div>
            {% endif %}              
            </div>
            <div class="form-footer">
                <input type="submit" class="btn btn-primary w-100" value="登    录" onClick="login_fun();"></input>
                <input id='loginpath' type='hidden' name='next' value='/admin/index'>
                {% comment %} {% if next %}
                    <input type='hidden' name='next' value='{{ next }}'>
                {% else %}
                    <input id='loginpath' type='hidden' name='next' value='/admin/index'>
                {% endif %} {% endcomment %}
            </div>
          </form>
        </div>
      </div>
      <div class="col-12 col-lg-6 col-xl-8 d-none d-lg-block">
        <!-- Photo -->
        <div class="bg-cover h-100 min-vh-100" style="background-image: url(/static/images/login_banner2.jpeg)"></div>
      </div>
    </div>
    <!-- Libs JS -->
    <!-- Tabler Core -->
    <script src="{% static "dist/js/tabler.min.js" %}" defer></script>
    <script src="{% static "dist/js/demo.min.js" %}" defer></script>
    <script>
        function login_fun() {
          {% comment %} document.getElementById('loginpath').value = '{{ next|add:"/admin/index" }}' {% endcomment %}
          document.getElementById('loginpath').value = "/admin/index"
        }
    </script>
  </body>
</html>